// Includes
#include "WindowsHelpers.h"

#include <windows.h>		// Windows API header
#include <cstdio>			// C library standard I/O

#ifdef _WIN32
	#pragma warning (disable : 4996)		// Disable warning for unsafe sscanf() and sprintf()
#endif

namespace EraAstral
{
	// Returns the local time as a string
	std::string GetTimeStr()
	{
		// Return value
		std::string retVal;
		// Character buffer
		char buffer[9];
		
		// System time object
		SYSTEMTIME localTime;
		// Get local time
		GetLocalTime(&localTime);
		
		// Print time string
		sprintf(buffer, "%02d:%02d:%02d", localTime.wHour, localTime.wMinute, localTime.wSecond);
		// Set return value
		retVal = buffer;
		
		return retVal;
	}
}
